﻿<%@ Page Title="" Language="C#" MasterPageFile="~/administrator/backend.Master" AutoEventWireup="true" CodeBehind="excercise-group-add.aspx.cs" Inherits="VQWEB.administrator.english.excercises.excercise_group_add" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Content_backend" runat="server">
    <form id="frm_groupExcercise" runat="server" role="form">
    <asp:FormView ID="frmGroupExcercise" runat="server" RenderOuterTable="false" 
        onitemcreated="frmGroupExcercise_ItemCreated">
        <EditItemTemplate>
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">
                <label>
                   Title</label>             
                
             <input class="form-control" type="text" name="group_excercise_title" value='<%# Eval("group_excercise_title")%>' />
            </div>
            <div class="form-group">
                <label>
                   Files</label>             
                
             <input class="form-control" id="get_files" type="text" name="group_excercise_file" value='<%# Eval("group_excercise_file")%>' />
            </div>
            <div class="form-group">
                <label>
                   Noi dung bo sung dau</label>
                <textarea class="form-control" cols="3" name="group_excercise_content_first" rows="3"><%# Eval("group_excercise_content_first")%></textarea>
            </div>
            <div class="form-group">
                <label>
                   Noi dung bo sung cuoi</label>                
                <textarea class="form-control" cols="3" name="group_excercise_content_last" rows="3"><%# Eval("group_excercise_content_last")%></textarea>
            </div>
         <div class="radio">
                <label>
                    <input type="radio" name="type_code" value="read" <%# Eval("type_code") != null && Eval("type_code").Equals("read") ? " checked='checked'" : null %> />
                    Select Reading
                </label>
            </div>
            <div class="radio">
                <label>
                    <input type="radio" name="type_code" value="listen"  <%# Eval("type_code") != null && Eval("type_code").Equals("listen") ? " checked='checked'" : null %> />
                    Or Select Listening
                </label>
            </div>
            <div class="checkbox">
                <label>
                    <input <%# Eval("group_excercise_active") !=null && (bool)(Eval("group_excercise_active")) ? " checked='checked'" : null %>
                        name="group_excercise_active" type="checkbox" value="True" />
                    Active Group Excercise
                </label>
            </div>
            <input name="group_excercise_id" type="hidden" value='<%# (Eval("group_excercise_id") != null) ? Eval("group_excercise_id") : "0" %>' />
            </div>
             <div class="col-md-6">
               <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title">
                                Excercise</h3>
                        </div>
                        <div class="panel-body">
                             <asp:Literal ID="ltrExcercise" runat="server" />
                        </div>
                    </div>
             
            </div>
        </div>        
        </EditItemTemplate>        
    </asp:FormView>
    </form>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Script_backend" runat="server">
    <script type="text/javascript">
        ShowToolBar("edit");
        var url_ashx = "/admin/english/excercise/handler";
        $("#btnCancel").live("click", function () {
            window.location = "/admin/english/excercise/group/list";
        });
        $("#btnSave").live("click", function () {
            var arr = $("#frm_groupExcercise").serializeObject();
            $.post(url_ashx, { add_excercise_group: window.escape(arr) }, function (data) {
                alert(data);
                window.location = "/admin/english/excercise/group/list";
            });
        });
    </script>
</asp:Content>
